package net.comm.shequ.db;


import java.sql.ResultSet;
import java.sql.SQLException;


import net.comm.blog.bean.BaseBlog;
import net.comm.param.bean.BaseProperty;
import net.comm.shequ.bean.BaseJgShenqing;
import net.comm.shequ.bean.BaseShequ;
import net.comm.util.StringUtil;

import org.apache.log4j.Logger;
import org.sakaiproject.db.api.SqlReader;

public class DbJgShenqingService implements SqlReader
{

	static Logger logger = Logger.getLogger(DbJgShenqingService.class.getName());

	/**
	 * Read from the result one set of fields to create a Resource.
	 * 
	 * @param result
	 *        The Sql query result.
	 * @return The Resource object.
	 */
	public Object readSqlResultRecord(ResultSet result)
	{
		try
		{		
			
			int 	seqID = result.getInt(1);	//	申请ID
			String 	jgType = StringUtil.getValue(result.getString(2));	//	机构类型
			String 	jgName = StringUtil.getValue(result.getString(3));	//	机构名称
			int 	villageID = result.getInt(4);						//	服务社区
			String 	content = StringUtil.getValue(result.getString(5));	//	服务内容
			int 	userID = result.getInt(6);							//	负责人
			String 	tel = StringUtil.getValue(result.getString(7));		//	联系方式
			int 	f_ID1 = result.getInt(8);							//	相关资料一
			int 	f_ID2 = result.getInt(9);							//	相关资料二
			String 	status = StringUtil.getValue(result.getString(10));	//	
			String 	mtime = StringUtil.getValue(result.getString(11));	//	申请时间

			// create the Resource from these fields
			return new BaseJgShenqing( seqID,  jgType,  jgName, villageID,  content,  userID, 
					tel,  f_ID1, f_ID2,status,  mtime );
		}
		catch (SQLException e)
		{
			logger.error("读取表数据持久层失败！");
			return null;
		}
		
	}
}
